﻿<dialogs:DialogWindow x:Class="Mnk.TBox.Plugins.RegExpTester.Dialog"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:loc="clr-namespace:Mnk.TBox.Plugins.RegExpTester.Code.Localization"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WPFControls"
                xmlns:wpfSyntaxHighlighter="clr-namespace:Mnk.Library.WpfSyntaxHighlighter;assembly=Mnk.Library.WPFSyntaxHighlighter"
                      xmlns:regularExpressions="clr-namespace:System.Text.RegularExpressions;assembly=System"
                      xmlns:components="clr-namespace:Mnk.Library.WpfControls.Components;assembly=Mnk.Library.WPFControls"
                      xmlns:units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WpfControls"
                      mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             ShowInTaskbar="True" Title="{loc:Tr PluginName}"
             Width="640" Height="480"
             FocusManager.FocusedElement="{Binding ElementName=RegExp}"
             MinWidth="640" MinHeight="480">
    <DockPanel>
        <units:ComboBoxUnit ItemsSource="{Binding Profiles}" Name="Profiles" UnitType="Text" Title="{loc:Tr ConfigureProfile}" DockPanel.Dock="Top" ValueCaption="{Binding SelectedProfile}" />
        <DockPanel Name="Data" Margin="5" DataContext="{Binding ElementName=Profiles, Path=SelectedValue }" IsEnabled="{Binding ElementName=Profiles,Path=IsSelected}">
        <StatusBar DockPanel.Dock="Bottom">
            <StatusBarItem Content="{loc:Tr Count}"/>
            <StatusBarItem Name="sbCount"/>
            <StatusBarItem Content="{loc:Tr Time}"/>
            <StatusBarItem Name="sbTime"/>
            <StatusBarItem Name="sbErrorCaption" Content="{loc:Tr Error}" Background="Red"/>
            <StatusBarItem Name="sbError" Background="Red"/>
            <StatusBarItem HorizontalAlignment="Right">
                <Button Content="{loc:Tr Cancel}" Padding="5,0" Click="CancelClick" IsCancel="True"/>
            </StatusBarItem>
        </StatusBar>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" MinWidth="128"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="*" MinWidth="128"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="128" MinHeight="64"/>
                <RowDefinition Height="5"/>
                <RowDefinition MinHeight="64"/>
            </Grid.RowDefinitions>
            <DockPanel Grid.ColumnSpan="3">
                <DockPanel DockPanel.Dock="Right" Width="200">
                    <WrapPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center">
                        <Button Content="{loc:Tr TestExpression}" Padding="5,0" Margin="2" IsEnabled="{Binding IsChecked, ElementName=TestManual}" Click="ButtonTestClick" />
                        <CheckBox Name="TestManual" IsChecked="{Binding TestManual}" Content="{loc:Tr TestManual}" VerticalAlignment="Center"/>
                    </WrapPanel>
                    <components:FlagsCheckBoxes Value="{Binding Options}" Name="Options" Caption="{loc:Tr Options}" Margin="5" BaseType="regularExpressions:RegexOptions" Orientation="Vertical" ValueChanged="DataChanged"/>
                </DockPanel>
                <Label Content="{loc:Tr RegularExpression}" DockPanel.Dock="Top" Padding="5,0"/>
                <TextBox Text="{Binding RegExp}" Name="RegExp" AcceptsTab="True" AcceptsReturn="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" TextChanged="DataChanged"/>
            </DockPanel>
            <GridSplitter HorizontalAlignment="Stretch" Grid.Row="1" Grid.ColumnSpan="3" />
            <DockPanel Grid.Row="2">
                <Label Content="{loc:Tr Text}" DockPanel.Dock="Top" Padding="5,0"/>
                <wpfSyntaxHighlighter:SyntaxHighlighter Name="Text" Text="{Binding Text}" IsWordWrap="True" TextChanged="OnTextChanged" />
            </DockPanel>
            <GridSplitter VerticalAlignment="Stretch" HorizontalAlignment="Stretch" ResizeDirection="Columns" Grid.Row="1" Grid.Column="1" Grid.RowSpan="2" />
            <DockPanel Grid.Row="2" Grid.Column="2">
                <Label Content="{loc:Tr Results}" DockPanel.Dock="Top" Padding="5,0"/>
                <TreeView Name="Results" HorizontalContentAlignment="Stretch"/>
            </DockPanel>
        </Grid>
        </DockPanel>
    </DockPanel>
</dialogs:DialogWindow>
